<?php
/**
 * @package		orcamento	
 * @desc		Componente voltado to listar produtor e entreoutros
 * @author	    Lucas Emmanoel Araujo Machado (lucasemmanoel@gmail.com).
 * @since		2011-04-10	
 * @abstract	Template para exibir os dados do componente.
 */

// Não permite o acesso direto ao arquivo.
defined( '_JEXEC' ) or die( 'Restricted access' );

?>
<form action="index.php?option=com_orcamento" method="post" name="searchadminForm">
	<table width="100%">
		<tr>
			<td align="left">
				<strong><?php echo JText::_( 'Nome' ); ?>:</strong>
				<input type="text" name="search" id="search" value="<?php echo $this->lists[ 'search' ];?>" class="inputbox" />
				<button onclick="this.form.submit( );">
					<?php echo JText::_( 'Go' ); ?>
				</button>
				<button onclick="document.getElementById('search').value='';this.form.submit( );">
					<?php echo JText::_( 'Limpar filtro' ); ?>
				</button>
			</td>
			<td align="right">
				<?php echo $this->lists['filtro_nome'] ?>
			</td>
		</tr>
	</table>
	<input type="hidden" name="view" value="categorias" />
</form>
<form action="index.php?option=com_orcamento" method="post" name="adminForm">
	<div id="editcell">
		<table class="adminlist">
			<!--/ cabeçalho /-->
			<thead>
				<tr style="background-color: #f2f2f2;">
					<th width="4%">#</th>
					<th width="2%">
						<input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo count( $this->registros ); ?>);" />
					</th>
					<th nowrap="nowrap" class="title" width="90%" style="text-align:left">
						<?php echo JHTML::_('grid.sort',  'Nome', 'p.nome', @$this->lists[ 'order_Dir' ], @$this->lists[ 'order' ] ); ?>
					</th>
					<th width="4%">
						<?php echo JText::_( 'id' ); ?>
					</th>
				</tr>
			</thead>
			<!--/ corpo /-->
			<tbody>
				<?php
				$i = $this->limitstart;
				for ( $a = 0 ; $a < count( $this->registros ) ; $a++ )
				{
					$row = &$this->registros[ $a ];
					$checked = JHTML::_('grid.id',   $i, $row->id );
					$link = JRoute::_( 'index.php?option=com_orcamento&controller=categoria&task=edit&cid[]='. $row->id );
				?>
				<tr class="<?php echo 'row' . ( $i % 2 ); ?>" >
					<td align="center">
						<?php echo $i+1; ?>
					</td>
					<td align="center">
						<?php echo $checked; ?>
					</td>
					<td>
						<a href="<?php echo $link; ?>"><?php echo $row->nome; ?></a>
					</td>
					<td align="center">
						<?php echo $row->id; ?>
					</td>
				</tr>
				<?php
					$i++;
				}
				?>
			</tbody>
			<!--/ rodapé /-->
			<tfoot>
				<tr>
					<td colspan="4">
						<?php echo $this->paginacao; ?>
					</td>
				</tr>
			</tfoot>
		</table>
	</div>

	<input type="hidden" name="task" value="" />
	<input type="hidden" name="boxchecked" value="0" />
	<input type="hidden" name="controller" value="categoria" />
	<input type="hidden" name="view" value="categorias" />
	<input type="hidden" name="filter_order" value="<?php echo $this->lists[ 'order' ]; ?>" />
	<input type="hidden" name="filter_order_Dir" value="<?php echo $this->lists[ 'order_Dir' ]; ?>" />
</form>
